package edu.purdue.cs.aggr.message;

import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;

public class ControllerCommandMessage extends Message
{
  private String type;
  private String nodeId;
  
  @Override
  public void readExternal(ObjectInput in) throws IOException,
      ClassNotFoundException {
    super.readExternal(in);
    type = (String) in.readObject();
    nodeId = (String) in.readObject();
  }

  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    super.writeExternal(out);
    out.writeObject(type);
    out.writeObject(nodeId);
  }
  
  public final String getType()
  {
    return type;
  }
  public final void setType(String type)
  {
    this.type = type;
  }
  public final String getNodeId()
  {
    return nodeId;
  }
  public final void setNodeId(String nodeId)
  {
    this.nodeId = nodeId;
  }
  
  public String toString() {
    return type + ": " + nodeId;
  }
}
